import axios from "axios"
const user = {
  namespaced: true,
  state: {
    userInfo: null, //获取用户的一些信息，可以用作页面的判断
  },
  getters: {
    userInfo: state => state.userInfo
  },
  mutations: {
    logout(state, vm) {
      sessionStorage.removeItem('user');
      sessionStorage.removeItem('password');
    },
    upDataUserInfo(state, userInfo) {
      state.userInfo = userInfo
    }
  },
  actions: {
    getUserInfo({
      commit
    }) {
      // axios.get("/admin/getUserInfo").then(res => {
      //   commit(res)
      // })
    }
  },
};

export default user;
